import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import UploadImage from '@/components/UploadImage'
Vue.use(ElementUI)
Vue.config.productionTip = false
Vue.component('UploadImage', UploadImage)

Vue.prototype.require = require('@/assets/12.16.jpg')
//自定义指令
Vue.directive('fiximg', {
    inserted(el, option) {
        el.addEventListener('error', () => {
            el.src = option.value
        })
        el.src = el.src || option.value
    },
    componentUpdated(el, option) {
        el.src = el.src || option.value
    }
})

new Vue({
    store,
    router,
    render: h => h(App),
}).$mount('#app')